package com.learn.dubbo.consumer;

import com.learn.dubbo.service.HelloService;
import org.springframework.context.support.ClassPathXmlApplicationContext;

public class DubboConsumerXmlBootstrap {

    public static void main(String[] args) {
        ClassPathXmlApplicationContext context = new ClassPathXmlApplicationContext();
        context.setConfigLocation("classpath:dubbo-consumer.xml");
        context.refresh();
        System.out.println("Dubbo Consumer (Xml) Is Starting...");
        HelloService helloService = context.getBean("helloService", HelloService.class);
        for (int i = 0; i < 10; i++) {
            System.out.println(helloService.sayHello("Dubbo && Nacos"));
        }
        context.close();
    }
}